/*
 * @Author: 陆成杰
 * @Date: 2022-06-26 14:38:34
 * @LastEditTime: 2022-07-05 09:01:04
 * @LastEditors: 陆成杰
 * @FilePath: /boe/vite.config.ts
 * Copyright (c) ${now_year} by zucc-陆成杰, All Rights Reserved. 
 */
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
  // server: {
  //   open: true,
  //   hmr: true
  // },
  plugins: [vue()],
  server: {
    open: true,//启动项目自动弹出浏览器
    hmr: true,
    port: 3000,//启动端口
    proxy: {
      '/api': {
        target: 'http://boe.tclx.xyz:8888/',	//实际请求地址
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      },
    }
  }
})
